package org.zjx.strategy.impl;

import org.zjx.command.ICommand;
import org.zjx.command.basic.ClickCommand;
import org.zjx.core.GameWindow;
import org.zjx.strategy.IGameStrategy;
import java.awt.image.BufferedImage;

/**
 * 默认策略
 */
public class DefaultStrategy implements IGameStrategy {
    @Override
    public ICommand analyze(GameWindow window, BufferedImage screenshot) {
        // 随机点击作为默认行为
        int x = (int) (Math.random() * screenshot.getWidth());
        int y = (int) (Math.random() * screenshot.getHeight());
        return new ClickCommand(window, x, y);
    }

    @Override
    public String getStrategyName() {
        return "DefaultStrategy";
    }

    @Override
    public int getPriority() {
        return 100; // 最低优先级
    }

    @Override
    public boolean isApplicable(GameWindow window, BufferedImage screenshot) {
        // 默认策略总是适用
        return true;
    }
}